import time
def read(file):
    f = open(file)
    s = [int(x) for x in f]
    return s

def sort(g):
    for j in range(len(g)-1):
        for i in range(len(g) - j - 1):
            if g[i] > g[i +1]:
                g[i], g[i + 1] = g[i + 1], g[i]
    return g

m1 = read("/home/student/Рабочий стол/Веселовский Вадим/m1_sorted.txt")
m2 = read("/home/student/Рабочий стол/Веселовский Вадим/m2_reverse.txt")
m3 = read("/home/student/Рабочий стол/Веселовский Вадим/m3_shuffle.txt")

m1_s = time.time()
m1_line = sort(m1)
m1_f = time.time()

m2_s = time.time()
m2_line = sort(m2)
m2_f = time.time()

m3_s = time.time()
m3_line = sort(m3)
m3_f = time.time()



print("m1_sorted", round(m1_f-m1_s)*1000, "millsec")
print("m2_reverse", round(m2_f-m2_s)*1000, "millsec")
print("m3_shuffle", round(m3_f-m3_s)*1000, "millsec")
